﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RichFrame.StateMachine
{
    public abstract class StateManager<T> where T : IBaseState
    {
        public T currentState;
        public virtual void Update()
        {
            if (currentState != null)
            {
                currentState.Update();
            }
        }
        public virtual void MakeTransition(T state)
        {
            if (currentState != null)
            {
                currentState.QuitState();
            }
            currentState = state;
            currentState.EnterState();
        }
    }
}
